<template>
	<view class="container">
		<view v-if="userList.length> 0" class="container-list" v-for="(item,index) in userList" :key="index">
			<u-read-more showHeight="200" toggle>
				<rich-text :nodes="item.RecommendationText" style="white-space: pre-wrap;"></rich-text>
			</u-read-more>
		</view>
		<u-empty v-else mode="data" icon="http://cdn.uviewui.com/uview/empty/car.png"></u-empty>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userInfo: {},
				userList: []
			}
		},
		onLoad() {
			this.userInfo = JSON.parse(uni.getStorageSync('userInfo'))
			this.getList(this.userInfo.OfficerID)
		},
		methods: {
			async getList(id) {
				const {
					data
				} = await uni.$http.get('/get_user_suggestions', {
					OfficerID: id
				})
				if (data.code === 200) {
					this.userList = data.records
				}

			}
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		padding: 20rpx;
		height: 100vh;
		overflow: auto;
		box-sizing: border-box;
		background-color: #f8f8f8;

		.container-list {
			width: 100%;
			background-color: #fff;
			border-radius: 12rpx;
			padding: 20rpx;
			box-sizing: border-box;
			margin-bottom: 30rpx;
			box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.05);
			color: #999;

			view {
				margin-bottom: 10rpx;
				box-sizing: border-box;
			}
		}
	}
</style>